#pragma once

#include "vrdatacore_global.h"
#include "sound.h"
#include "effectbase.h"

namespace VrDataCore
{
	class VRDATACORE_EXPORT SoundEffectActor : public EffectBase
	{
	public:
		SoundEffectActor();
		virtual void buildPropertyMap();
		virtual void onMapLoadBegin(CoreBase::Map*){}
		virtual void onMapLoadEnd(CoreBase::Map*);
		virtual void reset(); 
		virtual void apply(CoreBase::ActorBase* actor);
		virtual void unApply(CoreBase::ActorBase* actor);
		virtual void pause(bool){}
		//void playQueued(float offsetSeconds = 0.0f);
		//void HandleActorTimers(const dtGame::Message& msg);
		//void onEnteredWorld();
		//void onRemovedFromWorld();
		void setLooping(QString looping);
		QString isLooping();
		void setGain(float gain);
		float getGain();
		void setPitch(float pitch);
		float getPitch();
		void setListenerRelative(QString lisrel);
		QString isListenerRelative();
		void setMaxDistance(float max);
		float getMaxDistance();
		void setLoadFile(QString file);
		QString getLoadFile();
	protected:
		virtual ~SoundEffectActor();
	private:
		osg::ref_ptr<OpenAudio::Sound>				_sound;
		QString										_soundFile;
	};
}